DESCRIPTION = "A Robot image with more full-featured + ROS  SDK + OpenCV Linux system functionality installed."

LICENSE = "MIT"

inherit core-image
inherit ros_distro_${ROS_DISTRO}
inherit ${ROS_DISTRO_TYPE}_image

IMAGE_FEATURES += " \
    debug-tweaks \
    tools-sdk \
    tools-profile \
    splash \
    nfs-server \
    tools-debug \
    ssh-server-dropbear \
    tools-testapps \
    hwcodecs \
    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', \
       bb.utils.contains('DISTRO_FEATURES',     'x11', 'x11-base x11-sato', \
                                                       '', d), d)} \
"
ISP_PKGS = ""
ISP_PKGS_mx8mp = "packagegroup-imx-isp"
ML_PKGS_mx8                = "packagegroup-imx-robot-ml"
ML_STATICDEV_mx8           = "tensorflow-lite-staticdev"

CORE_IMAGE_EXTRA_INSTALL += " \
    packagegroup-core-full-cmdline \
    packagegroup-tools-bluetooth \
    packagegroup-fsl-tools-audio \
    packagegroup-fsl-tools-gpu \
    packagegroup-fsl-tools-gpu-external \
    packagegroup-fsl-tools-testapps \
    packagegroup-fsl-tools-benchmark \
    packagegroup-fsl-gstreamer1.0 \
    packagegroup-fsl-gstreamer1.0-full \
    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston-init', '', d)} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'weston-xwayland xterm', '', d)} \
    ${ISP_PKGS} \
"
IMAGE_INSTALL += " cmake git clblast libeigen openblas openblas-dev opencv opencv-dev"

IMAGE_INSTALL += " \ 
    ${ML_PKGS} \
    ${@bb.utils.contains('ROS_DISTRO', 'kinetic', 'packagegroup-imx-ros-sdk-kinetic', '', d)} \
    ${@bb.utils.contains('ROS_DISTRO', 'melodic', 'packagegroup-imx-ros-sdk-melodic', '', d)} \
    ${@bb.utils.contains('ROS_DISTRO', 'dashing', 'packagegroup-imx-ros-sdk-dashing', '', d)} \
    ${@bb.utils.contains('ROS_DISTRO', 'eloquent', 'packagegroup-imx-ros-sdk-eloquent', '', d)} \
    ${@bb.utils.contains('ROS_DISTRO', 'foxy', 'packagegroup-imx-ros-sdk-foxy', '', d)} \
"

TOOLCHAIN_HOST_TASK += "nativesdk-cmake \
    ${@bb.utils.contains('ROS_DISTRO', 'kinetic', 'nativesdk-catkin', '', d)} \
    ${@bb.utils.contains('ROS_DISTRO', 'melodic', 'nativesdk-catkin', '', d)} \
"

TOOLCHAIN_TARGET_TASK += " \
    ${ML_STATICDEV} \
"

                                             